package cn.id68.www.http.cookie;


import java.util.List;

import cn.id68.www.http.cookie.store.CookieStore;
import cn.id68.www.http.utils.Exceptions;
import okhttp3.Cookie;
import okhttp3.CookieJar;
import okhttp3.HttpUrl;

/**
 * Created by Administrator on 2017/3/21.
 */

public class CookieJarImpl implements CookieJar {
    private CookieStore cookieStore

    public CookieJarImpl(CookieStore cookieStore) {
        if (cookieStore == null){
            Exceptions.illegelArgument("cookieStore can not be null.");
        }
        this.cookieStore = cookieStore;
    }

    @Override
    public void saveFromResponse(HttpUrl url, List<Cookie> cookies) {
        cookieStore.add(url,cookies);
    }

    @Override
    public List<Cookie> loadForRequest(HttpUrl url) {
        return null;
    }
}
